#!/bin/bash

echo "项目根目录：$1";
echo "部署根目录：$2";

echo "copy jar"
cp $1/service-api/target/service-api-1.0.jar $2/service-api-1.0.jar

echo "docker rebuild"

cp -r $1/deploy/ $2/

cd $2

docker rmi $(docker images -f "dangling=true" -q)

docker compose up --build -d
 
exit 0
